<%= render "group_show", group: @group %>
<% if @bills.length != 0 %>
    <div class="panel panel-default">
      <div class="panel-body"></div>
      <table class="table">
        <caption>最近的账单</caption>
        <thead>
        <th>出资人</th>
        <th>描述</th>
        <th>金额</th>
        <th>创建时间</th>
        <th>账单成员</th>
        <th>操作</th>
        </thead>
        <tbody>
        <% @bills.each do |bill| %>
            <tr>
              <td>
               <%= render "common/user_icon", user: bill.user %>
              </td>
              <td><%= bill.description %></td>
              <td><%= bill.amount %></td>
              <td><%= bill.created_time %></td>
              <td>
                <% one_bill_users(bill).each do |user| %>
                        <!--<span class="label label-info">
                            <%= link_to user.name, user_path(user) %>
                        </span>-->
                    <%= render "common/user_icon", user: user %>
                <% end %>
              </td>
              <td>
                <% if bill.user_id == current_user.id %>
                    <%= link_to "edit", edit_bill_path(bill), class: "btn btn-primary btn-xs" %>
                <% else %>
                    <%= link_to "edit", edit_bill_path(bill), class: "btn btn-primary btn-xs disabled" %>
                <% end %>
              </td>
            </tr>
        <% end %>
        </tbody>
      </table>
      <%= paginate @bills %>
    </div>
<% end %>